home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: uu4news.netcom.com!lavc!lavc!mlf
- From: mlf@support.com
- Subject: GETTING THE SYSTEM TI
- Message-ID: <9601201624.0N1GW01@support.com>
- Organization: L.A. Valley College Public BBS (818)985-7150
- X-Mailer: TBBS/PIMP v3.35
- Distribution: world
- Date: Sat, 20 Jan 96 16:24:04 -0800
-
-
- Ne> From: tate@netwest.com (Tate Griffin)
- Ne> Newsgroups: comp.lang.c++
- Ne> Subject: Getting the system time and date
- Ne> Date: Fri, 19 Jan 1996 23:52:34 MST
- Ne> Organization: Netwest
-
- Ne> How do I get the current time and date from a PC using C++?
-
-
- Here try this:
-
- // DATETIME.CPP (written for BORLAND TURBO C++ 3.0 for DOS)
-
- #include <conio.h>
- #include <time.h>
-
- int main(void) {
- struct tm *time_now;
- time_t secs_now;
- char str[80];
-
- tzset(); time(&secs_now);
- time_now = localtime(&secs_now);
- strftime(str, 80, "%A, %B %d, %Y, %I:%M:%S %p (%Z)", time_now);
- cprintf("\r\n%s\r\n\r\n",str);
- return(0);
- }
-
- ------------------------------------------------------------
- + Mike Flower + Software Designer +
- + 10227 Langmuir Ave. + >>>>>> Available for hire <<<<<< +
- + Sunland, CA 91040 + Call now for an interview, Today! +
- + email: MLF@support.com + 818/353-8394 +
- ------------------------------------------------------------
-
- ___ Blue Wave/QWK v2.12
-